import { game, profiler } from "cc";
import { NativeSdkHelper } from "./sdk/NativeSdkHelper";
import { ServerConfig } from "./net/ServerConfig";
import { RemoteAssetManager } from "./engine/RemoteAssetManager";
import { AudioController } from "./engine/AudioController";
import UIManager from "./engine/UIManager";
import { AccountModel } from "./game/model/AccountModel";
import SettingModel from "./game/model/SettingModel";


export default class GameController {

    public static instance: GameController = new GameController();

    public init() {
        // profiler.showStats()
        profiler.hideStats()
        NativeSdkHelper.init()
        ServerConfig.init()
        RemoteAssetManager.instance.init()
        AccountModel.instance.init()
        SettingModel.instance.init()

    }


    public restartGame() {
        // GameSocket.getInstance().closeSocket(false)
        UIManager.instance.closeAllView();
        AudioController.instance.stop()
        game.restart()
    }

    public gotoLoading() {
        UIManager.instance.closeAllView();
        // GameSocket.getInstance().closeSocket(false)
        AudioController.instance.stop()
        // UIManager.instance.showView(ViewConfig.viewConfig.ViewLoading)
    }

    public switchAccount() {
        // AccountModel.instance.account = ""
        // AccountModel.instance.token = ""
        // AccountModel.instance.password = ""
        // AccountModel.instance.nickname = ""
        // AccountModel.instance.save()
        this.gotoLogin()
    }

    public gotoLogin() {
        // UIManager.instance.closeAllView();
        // GameSocket.getInstance().closeSocket(false)
        // UIManager.instance.showView(ViewConfig.viewConfig.ViewLogin)
        // UIManager.instance.hideLoadingIcon()
    }

    public reInitGame(){
    }


   
}